//
//  CacheMgr.h
//  carcareIOS
//
//  Created by ileo on 15/12/17.
//  Copyright © 2015年 baozun. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface CacheMgr : NSObject

+(NSString *)tmpCachePathWithName:(NSString *)name;//临时文件路径
+(NSString *)nonTmpCachePathWithName:(NSString *)name;//非临时文件路径
+(CGFloat)cacheSize;//获取本地文件大小
+(void)clearCacheFinish:(void(^)())finish;//清除本地文件

@end

@protocol CacheOperator <NSObject>

-(BOOL)cacheWithName:(NSString *)name;//缓存到本地 返回成功与否
+(id)cacheDataWithName:(NSString *)name;//获取缓存数据

@end

@interface UIImage (Cache)

+(void)cacheImageWithURL:(NSString *)urlStr finish:(void(^)(UIImage *image))finish;//图片先从本地获取 没有再从网络请求

@end

@interface NSArray (Cache)<CacheOperator>
@end

@interface NSString (Cache)<CacheOperator>
@end

@interface NSDictionary (Cache)<CacheOperator>
@end
